import { requestClient } from '#/api/request';

import { downloadFileFromBlobPart } from '@vben/utils';

/**
 * 获取扣款订单列表
 */
export async function getOrderDeductionList(params: any) {
  return requestClient.get('/admin/OrderDeduction/index', params);
}

/**
 * 获取扣款订单详情
 */
export async function getOrderDeductionInfo(params: any) {
  return requestClient.get('/admin/OrderDeduction/edit', params);
}

/**
 * 添加扣款订单
 */
export async function addOrderDeduction(params: any) {
  return requestClient.post('/admin/OrderDeduction/add', params);
}

/**
 * 编辑扣款订单
 */
export async function editOrderDeduction(params: any) {
  return requestClient.post('/admin/OrderDeduction/edit', params);
}

/**
 * 删除扣款订单
 */
export async function deleteOrderDeduction(params: any) {
  return requestClient.delete('/admin/OrderDeduction/del', params);
}

/**
 * 审核扣款订单
 */
export async function approvalOrderDeduction(params: any) {
  return requestClient.post('/admin/OrderDeduction/approval', params);
}

/**
 * 反审扣款订单
 */
export async function againstOrderDeduction(params: any) {
  return requestClient.post('/admin/OrderDeduction/against', params);
}

/**
 * 导出扣款订单数据
 */
export async function exportExpiredData(params: any) {
  return requestClient.get('/admin/OrderDeduction/downRecord', params, )
}

/**
 * 导入扣款订单数据
 */
export async function importFile(params: any) {
  return requestClient.post('/admin/OrderDeduction/import', params);
}

/**
 * 获取初始化数据（下拉选项等）
 */
export async function getInitData(params?: any) {
  return requestClient.get('/admin/OrderDeduction/addInit', params);
}

/**
 * 获取采购商品列表（用于选择录入）
 */
export async function getPurchaseGoodsList(params: any) {
  return requestClient.get('/admin/GoodsPurchase/index', params);
}

/**
 * 获取物料采购详情列表（用于物料逾期扣款）
 */
export async function getPurchaseBomDetail(params: any) {
  return requestClient.get('/admin/PurchaseBomDetail/index', params);
}

export async function getGoodsPurchaseGoodsList(params: any) {
  return requestClient.post('/admin/GoodsPurchase/goodsList', params);
}
